//
//  FPLoanDetailModel.h
//  FinanceProject
//
//  Created by 陈显摆 on 2025/2/11.
//

#import <JSONModel/JSONModel.h>

NS_ASSUME_NONNULL_BEGIN

@protocol FPRepaymentSchedules <NSObject>
@end

@interface FPRepaymentSchedules : JSONModel

@property (nonatomic , strong) NSString *amount;
@property (nonatomic , strong) NSString *balanceAfter;
@property (nonatomic , strong) NSString *createTime;
@property (nonatomic , strong) NSString *disbursementStatus;
@property (nonatomic , strong) NSString *dueAmount;

@property (nonatomic , strong) NSString *ID;
@property (nonatomic , strong) NSString *installmentNumber;
@property (nonatomic , strong) NSString *interest;
@property (nonatomic , strong) NSString *lengthOfMaturity;
@property (nonatomic , strong) NSString *loanId;

@property (nonatomic , strong) NSString *overdueDay;
@property (nonatomic , strong) NSString *penalInterest;
@property (nonatomic , strong) NSString *principal;
@property (nonatomic , strong) NSString *repaymentDate;
@property (nonatomic , strong) NSString *repaymentStatus;

@property (nonatomic , strong) NSString *status;
@property (nonatomic , strong) NSString *statusDescription;
@property (nonatomic , strong) NSString *updateTime;
@property (nonatomic , strong) NSString *userId;


@end



@protocol FPLoanDetailListModel <NSObject>
@end
@interface FPLoanDetailListModel : JSONModel

@property (nonatomic , strong) NSString *amount;
@property (nonatomic , strong) NSString *balanceAfter;
@property (nonatomic , strong) NSString *createTime;
@property (nonatomic , strong) NSString *ID;
@property (nonatomic , strong) NSString *installmentNumber;

@property (nonatomic , strong) NSString *interest;
@property (nonatomic , strong) NSString *loanId;
@property (nonatomic , strong) NSString *principal;
@property (nonatomic , strong) NSString *repaymentDate; //!< 计划还款日期
@property (nonatomic , strong) NSString *status; //!< 还款状态（0未还款 1已还款

@property (nonatomic , strong) NSString *disbursementStatus;
@property (nonatomic , strong) NSString *penal_interest; //!< 罚息
@property (nonatomic , strong) NSString *updateTime;
@property (nonatomic , strong) NSString *overdueDay;
@property (nonatomic , strong) NSString *penalInterest;

@property (nonatomic , strong) NSString *lengthofMaturity;
@property (nonatomic , strong) NSString *totalAmountToPay; //!< 总计要还


+ (void)getUserCurrenMonthLoan:(NSDictionary *)param success:(void (^)(NSInteger code , NSString *message , FPLoanDetailListModel *model))success failure:(void (^)(NSError *error))failure;



@end



@interface FPRepaymentSummary : JSONModel

@property (nonatomic , strong) NSString *overdueDay;
@property (nonatomic , strong) NSString *repaymentDate;
@property (nonatomic , strong) NSString *totalAmountToPay;

@property (nonatomic , strong) NSString *totalInterest;
@property (nonatomic , strong) NSString *totalPenalInterest;
@property (nonatomic , strong) NSString *totalPrincipal;

@end


@interface FPLoanDetailModel : JSONModel


//@property (nonatomic , strong) NSArray <FPLoanDetailListModel> *repaymentScheduleVo;
//@property (nonatomic , strong) NSString *totalAmount;   //!< 借款总金额
//@property (nonatomic , strong) NSString *totalLengthOfMaturity; //!< 总分期数

//@property (nonatomic , strong) NSString *totalAmountToPay;
//@property (nonatomic , strong) NSString *totalInterest;
//@property (nonatomic , strong) NSString *totalPrincipal;
//@property (nonatomic , strong) NSArray <FPLoanDetailListModel> *repaymentDetails;
@property (nonatomic , strong) FPRepaymentSummary *repaymentSummary;
@property (nonatomic , strong) NSArray <FPRepaymentSchedules> *repaymentSchedules;

/**
 *  个人中心 -> 去还款
 */
+ (void)getRepayMentSuccess:(void (^)(NSInteger code , NSString *message , FPLoanDetailModel *model))success failure:(void (^)(NSError *error))failure;

+ (NSString *)termOfParam:(NSString *)param;
+ (NSString *)timeOfParam:(NSString *)param;




@end

NS_ASSUME_NONNULL_END
